<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');

require_once JPATH_BASE .DS. 'components' .DS. 'com_mariageplanner' .DS. 'helpers' .DS. 'controllerform.php';

/**
 * Prize Controller
 */
class MariagePlannerControllerLayout extends MariagePlannerControllerBaseForm
{	
	public function getModel($name = 'Layout', $prefix = 'MariagePlannerModel', $config = array('ignore_request' => false))
	{		
		$model = parent::getModel($name, $prefix, $config);
	
		return $model;
	}
	
	function save_layout()
	{
		//$document = JFactory::getDocument();
		//$document->setMimeEncoding('application/json');

        $model = $this->getModel();
		$result = $model->saveLayout();

		$this->setRedirect(JRoute::_('index.php?option=com_mariageplanner&view=layout&id='.(int)JRequest::getInt('id'), false));
		
		return $result;
		
		//echo json_encode($result);
	}
}
?>